﻿@model Domain.Model.User

@section Script
{
    <link href="~/Content/validBox/validBox.css" rel="stylesheet" />
    <script src="~/Content/validBox/validBox.js"></script>
    <link href="~/Content/window/window.css" rel="stylesheet" />
    <script src="~/Content/window/window.js"></script>
    <script type="text/javascript">
        function saveForm() {
            $('form').validBox(function (r) {
                if (r == false) return;
                $.post("/user/userEdit", $('form').serialize(), function (data) {
                    if (data.state) {
                        location.href = "/user/activate";
                    } else {
                        window.messageBox('提示', data.value);
                    }
                });
            });
        }
    </script>
}
<div>
    <ul class="breadcrumb">
        <li><a href="/user/activate">用户管理</a> <span class="divider">/</span></li>
        <li class="active">用户编辑</li>
    </ul>
</div>

<form class="form-horizontal" method="POST">

    <p class="text-error"><b>第1步——填写登录信息</b> </p>

    <div class="control-group">
        <label class="control-label" for="Name">会员编号</label>
        <div class="controls">
            @Html.TextBoxFor(i => i.Account,Html.ValidFor(i=>i.Account))
        </div>
    </div>

    <div class="control-group">
        <label class="control-label" for="Name">会员昵称</label>
        <div class="controls">
            @Html.TextBoxFor(item => item.NickName, Html.ValidFor(item => item.NickName))
        </div>
    </div>
 
    <div class="control-group">
        <label class="control-label" for="Name">一级密码</label>
        <div class="controls">
            @Html.PasswordFor(item => item.Password, Html.ValidFor(item => item.Password))
        </div>
    </div>

    <div class="control-group">
        <label class="control-label" for="Name">登录密码确认</label>
        <div class="controls">
            @Html.Password("RePassword", Model.Password, Html.Valid().Required().EqualTo("Password", "两次密码不一致").AsHtmlAttribute())
        </div>
    </div>

    <div class="control-group">
        <label class="control-label" for="Name">交易密码</label>
        <div class="controls">
            @Html.PasswordFor(item => item.ExchangePassword, Html.ValidFor(item => item.ExchangePassword))
        </div>
    </div>
    <div class="control-group">
        <label class="control-label" for="Name">交易密码确认</label>
        <div class="controls">
            @Html.Password("ReExchangePassword", Model.ExchangePassword, Html.Valid().Required().EqualTo("ExchangePassword", "两次密码不一致").AsHtmlAttribute())
        </div>
    </div>
    

    <div class="text-error">第2步——填写区域信息  </div>

    <div class="control-group">
        <label class="control-label" for="Name">省份、城市、地区</label>
        <div class="controls">
            @Html.TextBoxFor(item => item.Name, Html.ValidFor(item => item.Name))
        </div>
    </div>
    <div class="control-group">
        <label class="control-label" for="Name">详细地址</label>
        <div class="controls">
            @Html.TextBoxFor(item => item.Address, Html.ValidFor(item => item.Address))
        </div>
    </div>
    <div class="control-group">
        <label class="control-label" for="Name">姓名</label>
        <div class="controls">
            @Html.TextBoxFor(item => item.Name, Html.ValidFor(item => item.Name))
        </div>
    </div>


    <p class="text-error">第3步——第3步——进一步完善资料（选填项，可不填）  </p>

    <div class="control-group">
        <label class="control-label" for="Name">会员级别</label>
        <div class="controls">
            @Html.DropDownListFor(item => item.Level, new SelectList(Model.Level.GetNameDisplays(), "Key", "Value"))
          @*  @Html.TextBoxFor(item => item.Level, Html.ValidFor(item => item.Level))*@
        </div>
    </div>
    <div class="control-group">
        <label class="control-label" for="Name">推荐人</label>
        <div class="controls">
            @Html.TextBoxFor(item => item.Referrer, Html.ValidFor(item => item.Referrer))
        </div>
    </div>
    <div class="control-group">
        <label class="control-label" for="Name">接点人</label>
        <div class="controls">
            @Html.TextBoxFor(item => item.ContactPerson, Html.ValidFor(item => item.ContactPerson))
        </div>
    </div>
    <div class="control-group">
        <label class="control-label" for="Name">市场</label>
        <div class="controls">
            @Html.TextBoxFor(item => item.Market, Html.ValidFor(item => item.Market))
        </div>
    </div>
    <div class="control-group">
        <label class="control-label" for="Name">性别</label>
        <div class="controls">
            @Html.DropDownListFor(i => i.Gender, ViewData["Gender"] as IEnumerable<SelectListItem>)
        </div>
    </div>
    <div class="control-group">
        <label class="control-label" for="Name">手机号码</label>
        <div class="controls">
            @Html.TextBoxFor(item => item.TelPhone, Html.ValidFor(item => item.TelPhone))
        </div>
    </div>
    <div class="control-group">
        <label class="control-label" for="Name">邮箱</label>
        <div class="controls">
            @Html.TextBoxFor(item => item.Email, Html.ValidFor(item => item.Email))
        </div>
    </div>
    <div class="control-group">
        <label class="control-label" for="Name">QQ</label>
        <div class="controls">
            @Html.TextBoxFor(item => item.QQ, Html.ValidFor(item => item.QQ))
        </div>
    </div>

    <div class="control-group">
        <label class="control-label"></label>
        <div class="controls">
            <input type="button" onclick="saveForm(); return false;" class="btn btn-info" value="保存" />
            <input type="button" class="btn btn-info" value="取消" onclick="history.go(-1); return false;" />
        </div>
    </div>


    @Html.HiddenFor(item => item.ID)
    @Html.HiddenFor(i => i.RoleId)
    @Html.HiddenFor(i => i.Password)
</form>
